package com.basketball.gym.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(description = "返回类")
public class ResponseData<T> {
    @ApiModelProperty("状态信息")
    private String message;
    @ApiModelProperty("状态码")
    private int status;
    @ApiModelProperty("accessToken")
    private String token;
    @ApiModelProperty("refreshToken")
    private String refreshToken;
    @ApiModelProperty("返回数据")
    private T data;

    public ResponseData() {
    }

    public ResponseData(String message, int state) {
        this.message = message;
        this.status = state;
    }

    public ResponseData(String message, int state, T data) {
        this.message = message;
        this.status = state;
        this.data = data;
    }

    public ResponseData(String message, int state, String token, String refreshToken) {
        this.message = message;
        this.status = state;
        this.token = token;
        this.refreshToken = refreshToken;
    }

    public ResponseData(String message, int state, String token, String refreshToken, T data) {
        this.message = message;
        this.status = state;
        this.token = token;
        this.refreshToken = refreshToken;
        this.data = data;
    }


    public void setMessageState(String message, int state) {
        this.message = message;
        this.status = state;
    }


    public void setTokens(String token, String refreshToken) {
        this.token = token;
        this.refreshToken = refreshToken;
    }
}
